package edu.byu.isys413.jjenkins.data; 

/**
 * The super-class of all business objects in the program.
 *
 * @author Conan C. Albrecht
 * @author Jeff Jenkins
 */
public abstract class BusinessObject {
    //should now be in ttest3 on google code
    //confirmed, it is there
    
    boolean objectAlreadyInDB = false;
    protected String id = null;
    protected boolean dirty = false;
    
    /** Creates a new instance of BusinessObject */
    public BusinessObject() {
    }//constructor
    
 /* get the customer's id
  * @return: String: id*/
    public String getId() {
        return id;
    }
    
 /* sets the customer's id
  * @par: String: id*/
    protected void setId(String id) {
        this.id = id;
        setDirty(true);
    }
    
 /* checks to see if the object is already in the database
  * @return: Boolean: objectAlreadyInDB*/
    boolean isObjectAlreadyInDB() {
        return objectAlreadyInDB;
    }
    
 /* sets the already in database boolean
  * @par: boolean: objectAlreadyInDB*/
    void setObjectAlreadyInDB(boolean objectAlreadyInDB) {
        this.objectAlreadyInDB = objectAlreadyInDB;
    }
    
 /* checks to see if the object has changed
  * @return: boolean: dirty*/
    
    public boolean isDirty() {
        return dirty;
    }
  /* sets dirty to indicate that whether the object has changed
  * @par: boolean: dirty*/
    
    public void setDirty(boolean dirty) {
        this.dirty = dirty;
    }
    
}//class
